package com.mangatta.cloud;

public enum Metric {
    CPU_UTILIZATION("CPUUtilization", "CPU Utilization", "Percent"),
    NETWORK_IN("NetworkIn", "Network In", "Bytes"),
    NETWORK_OUT("NetworkOut", "Network Out", "Bytes"),
    DISK_WRITE_BYTES("DiskWriteBytes", "Disk Write Bytes", "Bytes"),
    DISK_READ_BYTES("DiskReadBytes", "Disk Read Bytes", "Bytes"),
    DISK_READ_OPS("DiskReadOps", "Disk Read Ops", "Count"),
    DISK_WRITE_OPS("DiskWriteOps", "Disk Write Ops", "Count");

    private String name;
    private String unit;
    private String displayName;

    Metric(String name, String displayName, String unit) {
        this.name = name;
        this.displayName = displayName;
        this.unit = unit;
    }

    public String getDisplayName() {
        return displayName;
    }

    public String getName() {
        return name;
    }

    public String getUnit() {
        return unit;
    }
    
    public static Metric fromName(String name){
    	for(Metric m:values()){
    		if(m.getDisplayName().equals(name)){
    			return m;
    		}
    	}
    	return null;
    }
  
}
